package com.wyg.demo.service.impl;

import com.github.pagehelper.PageHelper;
import com.wyg.demo.domain.OperationLog;
import com.wyg.demo.domain.vo.OperationLogVo;
import com.wyg.demo.mapper.OperationLogMapper;
import com.wyg.demo.service.OperationLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ygWen
 * @Description 操作日志 业务层实现类
 * @date 2022/1/19
 */
@Service
public class OperationLogServiceImpl implements OperationLogService {
    
    @Autowired
    private OperationLogMapper operationLogMapper;

    /**
     * 分页展示操作日志列表
     * @param pageNum 页码
     * @param pageSize 每页数量
     * @param operationLogVo 操作日志类
     * @return 日志列表
     */
    @Override
    public List<OperationLog> listOperationLogByPage(int pageNum, int pageSize, OperationLogVo operationLogVo) {
        PageHelper.startPage(pageNum, pageSize);
        return operationLogMapper.listOperationLog(operationLogVo);
    }

    /**
     * 保存操作日志
     * @param operationLog 操作日志类
     */
    @Override
    public void saveOperationLog(OperationLog operationLog) {
        operationLogMapper.insertOperationLog(operationLog);
    }
}
